import { ASYNC_SET_NAME, PROMISE_SET_NAME, SET_NAME } from "./../actions-type";

let initState = {
  name: "张三",
};

function reducer(state = initState, action) {
  switch (action.type) {
    case SET_NAME:
      return { name: action.payload };
    case ASYNC_SET_NAME:
      return { name: action.payload };
    case PROMISE_SET_NAME:
      return { name: action.payload };
    default:
      return { name: state.name };
  }
}
export default reducer;
